package com.pactera.madp.cp.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pactera.madp.admin.api.dto.WxDeptDto;
import com.pactera.madp.common.core.util.R;
import com.pactera.madp.cp.api.entity.WorkDeptEntity;
import com.pactera.madp.cp.api.vo.dept.DeptEmployeeLinkVO;
import com.pactera.madp.cp.api.vo.dept.DeptRecursionVo;

import java.util.List;

public interface IWorkDeptService extends IService<WorkDeptEntity> {

    List<WorkDeptEntity> getWorkDepartmentsByCorpId(String corpId);

    boolean insertDeptments(List<WorkDeptEntity> workDeptEntityList,int corpId);

    Integer updDeptments(List<WorkDeptEntity> workDeptEntityList);

    JSONObject getWorkDepartments(String searchKeyWords, Integer corpId);

    JSONObject getWorkDepartments1(String searchKeyWords, Integer corpId);

    JSONArray getDeptMemberList(List<Integer> deptIds, Integer corpId);

    List<DeptRecursionVo> getAllDepts();

    List<WorkDeptEntity> getWorkDepartmentsById(String ids, String clStr);

    List<WorkDeptEntity> getWorkDepartmentsByCorpIdName(Integer corpId, String name, String clStr);

    List<WorkDeptEntity> getWorkDepartmentsByCorpIdPath(Integer corpId, String path, String id);

    List<WorkDeptEntity> getWorkDepartmentsBySearch(String substring, String clStr);

    List<WorkDeptEntity> getWorkDepartmentsByPath(int level, String path);

    /**
     * 根据部门 id 列表获取部门企业 id 列表
     */
    List<Integer> getWxDeptIdListByDeptIdList(List<Integer> deptIdList);

    List<WorkDeptEntity> getNameById(String departmentIds, String name);

    List<Integer> getAllChilds(Integer deptId);
    List<Integer> getAllAllowChilds(List<Integer> deptIds);

    R<Integer> createDept(WxDeptDto dto);

    R<Boolean> updateDept(WxDeptDto dto);

    R<Boolean> deleteDept(Integer wxDeptId);

    DeptEmployeeLinkVO getLinkObjects(Integer deptId);

}
